// pages/detail2/detail2.js
// 直播详情页

var app = getApp();
const landui = require("../../utils/util.js")

Page({

  /**
   * 页面的初始数据
   */
  data: {
    domain: app.globalData.domain,
    trueDomain: app.globalData.trueDomain,
    info:'',
    list3:[],
    url:'/pages/live/detail',
    current_nav:'live'
   
  },

  /**
   * 生命周期函数--监听页面加载
   * http://jk.hnla.cn/api/videos/{id}?include=expert
   */
  onLoad: function (options) {
    var that = this;
    var id = options.id;
    landui.common.post({
      module:'videos/'+4,
      param:{include:'expert'},
      success:function(res){
        res.data.add_time = res.data.add_time.substring(0,10)
        that.setData({
          info:res.data
        })
      },
      fail:function(){
      }
    });
    // http://jk.hnla.cn/api/getVideos?number=3
    landui.common.post({
      module: 'getVideos/',
      param: { number: 3 },
      success: function (res) {
        var i = 0;
        that.list3 = res.data;
        for (i; i < res.data.length; i++) {
          that.list3[i]['add_time'] = res.data[i].add_time.substring(0, 10)
        }
        that.setData({
          list3: that.list3
        })
      },
      fail: function () {
      }
    })
  },

  
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  }
})